package vip.xiaonuo.biz.modular.lancerCategory.controller;

import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.lang.tree.Tree;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import vip.xiaonuo.biz.modular.lancerCategory.service.BizCategoryService;
import vip.xiaonuo.common.pojo.CommonResult;

import java.util.List;

@Api(tags = "客户端管理(C端)")
@ApiSupport(author = "LANCER_TEAM", order = 1)
@Validated
@RestController("userClientCategoryController")
@RequestMapping
public class ClientCategoryController {
    @Autowired
    BizCategoryService categoryService;
    @ApiOperationSupport(order = 2)
    @ApiOperation("C端获取分类树选择器")
    @GetMapping("/biz/client/category/categoryTreeSelector")
    public CommonResult<List<Tree<String>>> tree() {
        return CommonResult.data(categoryService.treeClient());
    }
}
